// 2025/4/10
// 拓扑排序

https://www.nowcoder.com/practice/88f7e156ca7d43a1a535f619cd3f495c?tpId=308&tqId=40470&ru=/exam/oj
// 2025/4/11
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main() {
    int n, m, p, c; 
    cin >> n >> m;
    vector<vector<int>> adjlist(n + 1);
    vector<int> incnt(n + 1, 0);
    while(m--)
    {
        cin >> p >> c;
        adjlist[p].push_back(c);
        incnt[c]++;
    }
    queue<int> ready;
    vector<int> ans;
    for(int i = 1; i <= n; i++)
    {
        if(incnt[i] == 0)
            ready.push(i);
    }
    int count = 0;
    while(!ready.empty())
    {
        count++;
        int tmp = ready.front();
        ready.pop();
        ans.push_back(tmp);
        for(int i = 0; i < adjlist[tmp].size(); i++)
        {
            int cur = adjlist[tmp][i];
            --incnt[cur];
            if(incnt[cur] == 0)
                ready.push(cur);
        }
    }
    if(count == n)
    {
        for(int i = 0; i < n; i++)
        {
            cout << ans[i];
            if(i != n - 1)
                cout << " ";
        }
        cout << endl;
    }
    else 
    {
        cout << -1 << endl;    
    }
    return 0;
}
// 64 位输出请用 printf("%lld")